package com.lw.yygh.exception;

import com.lw.yygh.result.ResultCodeEnum;
import lombok.Data;

/**
 * 自定义全局异常类
 *
 * @author qy
 */
@Data
public class YyghException extends RuntimeException {

    private Integer code;;

    /**
     * 接收枚举类型对象
     * @param resultCodeEnum
     */
    public YyghException(ResultCodeEnum resultCodeEnum) {

        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
    }

    public YyghException(String message, Integer code) {
        super(message);
        this.code = code;
    }

}
